package com.gitee.ly.chain.springboot.test;

import com.alibaba.fastjson.JSON;
import com.gitee.ly.chain.abstractclass.GlobalTool;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.HashMap;
import java.util.Map;

/**
 * SpringBootTestMain
 *
 * @author ly
 **/
@SpringBootApplication
public class SpringBootTestMain implements ApplicationRunner {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootTestMain.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        GlobalTool.setJsonSerialHandle(JSON::toJSONString);
        GlobalTool.setLogInfoHandle(System.out::println);

        //执行流程
        GlobalTool.getFlow("ZJCKLC", Map.class).excute(new HashMap() {{
            put("aaa", "数据1");
            put("bbb", "数据2");
        }});
    }
}
